<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<kd-info-card>
  <kd-info-card-header>[[Details|Header in a detail view]]</kd-info-card-header>
  <kd-info-card-section>
    <kd-object-meta-info-card object-meta="::$ctrl.statefulSet.objectMeta">
    </kd-object-meta-info-card>
    <kd-info-card-entry title="[[Images|Stateful set info details section images entry.]]">
      <div ng-repeat="image in $ctrl.statefulSet.containerImages track by $index">
        <kd-middle-ellipsis display-string="{{::image}}"></kd-middle-ellipsis>
      </div>
      <div ng-repeat="image in $ctrl.statefulSet.initContainerImages track by $index">
        <kd-middle-ellipsis display-string="{{::image}}"></kd-middle-ellipsis>
      </div>
    </kd-info-card-entry>
  </kd-info-card-section>

  <kd-info-card-section name="[[Status|Stateful set info status section name.]]">
    <kd-info-card-entry title="[[Pods|Stateful set info status section pods entry.]]">
      <div ng-if="!$ctrl.areDesiredPodsRunning()">
        [[{{$ctrl.statefulSet.podInfo.current}} created|The message says that that many pods were created (stateful set details page).]], [[{{$ctrl.statefulSet.podInfo.desired}} desired|The message says that that many pods are desired to run (stateful set details
        page).]]
      </div>
      <div ng-if="$ctrl.areDesiredPodsRunning()">
        [[{{$ctrl.statefulSet.podInfo.running}} running|The message says that that many pods are running (stateful set details page).]]
      </div>
    </kd-info-card-entry>
    <kd-info-card-entry title="[[Pods status|Stateful set info status section pods status entry.]]"
                        ng-if="!$ctrl.areDesiredPodsRunning()">
      <div ng-if="!$ctrl.areDesiredPodsRunning()">
        <div ng-if="::$ctrl.statefulSet.podInfo.pending"
             class="kd-comma-separated-item">
          [[{{$ctrl.statefulSet.podInfo.pending}} pending|The message says that that many pods are pending (stateful set details page).]]
        </div>
        <div ng-if="::$ctrl.statefulSet.podInfo.failed"
             class="kd-comma-separated-item">
          [[{{$ctrl.statefulSet.podInfo.failed}} failed|The message says that that many pods have failed (stateful set details page).]]
        </div>
        <div ng-if="::$ctrl.statefulSet.podInfo.running"
             class="kd-comma-separated-item">
          [[{{$ctrl.statefulSet.podInfo.running}} running|The message says that that many pods are running (stateful set details page).]]
        </div>
      </div>
    </kd-info-card-entry>
  </kd-info-card-section>
</kd-info-card>
